/**
 * ErrorCode.java
 * 
 * Purpose              :
 * 
 * Optional info        : 
 *
 * @author              : Van Hoang Phuong
 * 
 * @date                : May 31, 2012
 * 
 * @lastChangedRevision : 
 *
 * @lastChangedDate     :
 *
 */
package com.applink.sell_proof.api;


/**
 * @author Hoang Viet
 * 
 */
public enum ErrorCode {
	NO_ERROR(0), NETWORK_ERROR(1), SERVER_ERROR(2), UNKNOWN_ERROR(3), TIME_OUT(
			4),NETWORK_LOST(5),DID_NOT_LOGIN(6);

	private int mErrorCode;

	ErrorCode(int errorCode) {
		mErrorCode = errorCode;
	}

	public static ErrorCode getErrorCode(int errorCode) {
		switch (errorCode) {
		case 0:
			return ErrorCode.NO_ERROR;
		case 1:
			return ErrorCode.NETWORK_ERROR;
		case 2:
			return ErrorCode.SERVER_ERROR;
		case 3:
			return ErrorCode.UNKNOWN_ERROR;
		case 4:
			return ErrorCode.TIME_OUT;
		case 5:
			return ErrorCode.NETWORK_LOST;
		case 6 :
			return ErrorCode.DID_NOT_LOGIN;
		default:
			return ErrorCode.UNKNOWN_ERROR;
		}
	}

	@Override
	public String toString() {
		switch (mErrorCode) {
		default:
			return "ERROR";
		}
	}
}
